/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import entity.Obat;
import entity.KelolaObat;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author artha
 */


public class LogikaObat {
    HttpServletRequest request;

    public LogikaObat(HttpServletRequest request) {
        this.request = request;
    }

    public String daftar() {
        Obat obat = new Obat();
        KelolaObat ka = new KelolaObat();

        String nambat = request.getParameter("Nama_obat");
        String ketbat = request.getParameter("ketobat");
        String nampen = request.getParameter("Nama_penyakit");
        
       
            obat.setNamaObat(nambat);
            obat.setKeterangan(ketbat);
            obat.setNamaPenyakit(nampen);
           ka.createObat(obat);
           return "obatsukses.jsp";

        
    
    }
}
